package entities;

import java.awt.Color;
import java.awt.Graphics2D;

/**
 *
 * @author casshern
 */
public class Miner extends GameObject {

    public static final int COST = 100;

    public Miner(int playerID, int x, int y, boolean alive) {
        this.playerID = playerID;
        this.type = GameObject.MINER;
        this.x = x;
        this.y = y;
        this.alive = alive;
        range = 60;
        size = 20;
        maxHealth = 100;
        currentHealth = maxHealth;
    }

    public Miner(int playerID, int x, int y, int currentHealth, boolean alive) {
        this.playerID = playerID;
        this.type = GameObject.MINER;
        this.x = x;
        this.y = y;
        this.currentHealth = currentHealth;
        this.alive = alive;
        range = 60;
        size = 20;
        maxHealth = 100;
    }

    @Override
    public void drawObject(Graphics2D g) {
        if (alive) {
            ImageMemory.Miner.paintIcon(null, g, x, y);
            g.setColor(Color.ORANGE);
            g.drawOval(x - (range - size) / 2, y - (range - size) / 2, range, range);
        } else if (!alive) {
            ImageMemory.Miner_DEAD.paintIcon(null, g, x, y);
        }
    }
}
